/**
 * $Id$ Copyright 2009-2012 Oak Pacific Interactive. All rights reserved.
 */
package com.shuqi.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;

import com.shuqi.activity.viewport.CommonTitle;
import com.shuqi.controller.R;
import com.shuqi.statistics.StatisticsEventID;
import com.shuqi.statistics.StatisticsUtils;

/**
 * 
 * 
 * @author <a href="mailto:">yaozhen</a>
 * @version 2014-2-13上午10:01:35
 */
public class FindPasswordActivity extends ActivityBase implements OnClickListener {
    private CommonTitle mTitle;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_account_findpassword);
        mTitle = (CommonTitle) findViewById(R.id.title);
        mTitle.setLeftClickListener(this);
        findViewById(R.id.findpassword_by_phone).setOnClickListener(this);
        findViewById(R.id.findpassword_by_email).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.findpassword_by_phone:
                StatisticsUtils.onEvent(StatisticsEventID.ACCOUNT_FINDPASSWORD_BYMOBILE_CLICK);
                AccountMobileBindActivity.show(this, AccountMobileBindActivity.TYPE_FINDPASSWORD);
                break;
            case R.id.findpassword_by_email:
                StatisticsUtils.onEvent(StatisticsEventID.ACCOUNT_FINDPASSWORD_BYEMAIL_CLICK);
                FindPasswordByEmailActivity.show(this);
                break;
            case R.id.title_left:
                ActivityManager.getInstance().finishActivity(this);
                break;

            default:
                break;
        }
    }

    @Override
    public void activityLogicForward() {

    }

    @Override
    public void activityInitData() {

    }

    public static void show(Activity context) {
        Intent intent = new Intent(context, FindPasswordActivity.class);
        ActivityManager.getInstance().startNextActivity(intent, context);
    }
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            ActivityManager.getInstance().finishActivity(this);
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}
